Manual Code and Action
This page describes key files and directories in the MediaWiki source code. For more detailed information, see the class, file and comprehensive references auto-generated from the MediaWiki source code using doxygen. Access points Directory /includes/ This directory stores common include files needed by MediaWiki. Directory /includes/actions/ This directory contains the Action classes, which handle the different actions which can be performed on pages (e.g. view, delete, edit, etc.). All these classes extend the Action, FormlessAction or FormAction classes. Some of them are just stubs which call methods in the Article or EditPage classes to do the actual work. Directory /includes/api/ This directory contains the code for the MediaWiki API. See API:Main page. The most important files are: Directory /includes/cache/ This directory contains files with code relating to MediaWiki's caching mechanisms. Directory /includes/context/ This directory contains a few classes related to (request)contexts. As of MediaWiki 1.18 the context of a request is encapsulated inside a RequestContext instance which implements IContextSource. A context is a way of grouping the parts of a request together. This reduces the need for globals. See Manual:RequestContext for more information. Directory /includes/db/ This directory contains the code for database support. Database.php provides MediaWiki's database abstraction layer. Directory /includes/diff/ This directory contains the standard MediaWiki difference engine. A difference engine computes the difference between two texts. Whether this difference engine is used or some external diff tool, depends on the $wgExternalDiffEngine setting. Directory /includes/job/ Files related to the job queue. Each job class for a specific type of job derives from the Job class and has to implement a run() method which does the actual job. Directory /includes/logging/ Some files related to logging the events which happen on a Wiki. This directory was introduced in MW 1.19. Some of the files were already present in olders versions, in the includes/ directory. Directory /includes/media/ This directory contains files for handling several media formats, mostly images. Directory /includes/normal/ This directory contains some Unicode normalization routines. See includes/normal/README for more information. Directory /includes/objectcache/ Files related to MediaWiki's caching mechanisms. The files in this directory provide the possibility to store objects in PHP accelerators, in memcached, in a database or in DBA files. Directory /includes/parser/ The MediaWiki parser, which transforms wikitext to HTML, can be found here together with related files. The most interesting files in this directory: Directory /includes/resourceloader/ Files related to ResourceLoader, a JavaScript/CSS delivery optimizing system for MediaWiki. Directory /includes/search/ This directory contains the code to implement the possibility of searching a wiki using one the possible backends. Directory /includes/specials/ This directory contains the code and classes for the standard . All special page classes derive from class SpecialPage (defined in includes/SpecialPage.php). Special pages which come with extension are located in their respective extensions directories. See also Manual:Special pages. Directory /includes/upload/ Files providing the backend of MediaWiki's file uploads. Directory /languages/ This directory contains files used for localization and internationalization. For a quick overview see Language in MediaWiki. Directory /maintenance/ This directory contains maintenance scripts that must be run from a command line interface. See Manual:Maintenance scripts for an overview of those scripts. Directory /resources/ This directory contains JavaScript and CSS resources used by MediaWiki, including jQuery. Directory /skins/ This directory contain all skins classes, JavaScripts, CSS and some images used by that skins. See Manual:Skins. Directory /tests/ Contains various (unit)test related files, including: *Parser tests *PHPUnit tests *QUnit tests *Selenium Framework